package com.xxx.video.commen.views;


import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;

import com.xxx.video.commen.utils.FontCacheUtils;

/**
 *
 */
public class FontTextView extends AppCompatTextView {
    public static final String ttf1 = "ttf/ALKATIP_Asliya.TTF";
    public static final String ttf2 = "ttf/ALKATIP_Basma.TTF";
    public static final String ttf3 = "ttf/alkatip_basma_tom.ttf";
    public static final String ttf4 = "ttf/ALKATIP_Gezit.TTF";
    public static final String ttf5 = "ttf/ALKATIP_Gezit_Tom.TTF";
    public static final String ttf6 = "ttf/ALKATIP_Jornal.TTF";
    public static final String ttf7 = "ttf/ALKATIP_Jornal_Tom.TTF";
    public static final String ttf8 = "ttf/ALKATIP_Kitab.TTF";
    public static final String ttf9 = "ttf/ALKATIP_Kitab_Tom.TTF";
    public static final String ttf10 = "ttf/ALKATIP_Kufi.TTF";
    public static final String ttf11 = "ttf/ALKATIP_Marka.TTF";
    public static final String ttf12 = "ttf/ALKATIP_Rukki.TTF";
    public static final String ttf13 = "ttf/ALKATIP_Talik.TTF";
    public static final String ttf14 = "ttf/ALKATIP_Tor.TTF";
    public static final String ttf15 = "ttf/ALKATIP_Tor_Tom.TTF";
    public static final String ttf16 = "ttf/ALKATIP_Yazma.TTF";
    public static final String ttf17 = "ttf/ALKATIP_Yazma_Tom.TTF";

    public FontTextView(@NonNull Context context) {
        super(context);
        applyCustomFont(context);
    }

    public FontTextView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        applyCustomFont(context);
    }

    public FontTextView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        applyCustomFont(context);
    }

    private void applyCustomFont(Context context) {
        Typeface customFont = FontCacheUtils.getInstance().getTypeface(ttf3, context);
        setTypeface(customFont);
    }
}
